package org.shuker.utils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author ：Shuker
 * @date ：Created in 2022/6/14 11:54
 * @description：
 * @version:
 */
public class ParameterMappingTokenHandler implements TokenHandler{

    private List<ParameterMapping> parameterMappingList = new ArrayList<>();
//    content是参数名称 #{id} #{username}

    @Override
    public String handlerToken(String content) {
        parameterMappingList.add(buildParameterMapping(content));
        return "?";
    }

    private ParameterMapping buildParameterMapping(String content){
        ParameterMapping parameterMapping = new ParameterMapping(content);
        return parameterMapping;
    }

    public List<ParameterMapping> getParameterMappingList(){
        return parameterMappingList;
    }

    public void setParameterMappingList(List<ParameterMapping> parameterMappingList) {
        this.parameterMappingList = parameterMappingList;
    }
}
